//
//  myplay.m
//  test1
//
//  Created by dllo on 15/10/20.
//  Copyright (c) 2015年 大远. All rights reserved.
//

#import "myplay.h"

@implementation myplay


+ (myplay *)sharePlayer{
    static myplay *play = nil;
    if (play == nil) {
        play = [[myplay alloc]init];
    }
    return play;
}

- (void)playMypath:(NSURL *)url{
    AVPlayerItem *item = [[AVPlayerItem alloc]initWithURL:url];
    [self replaceCurrentItemWithPlayerItem:item];
    [self play];
}


- (void)playMusicWithURL:(NSString *)url{

    AVPlayerItem *item = [[AVPlayerItem alloc]initWithURL:[NSURL URLWithString:url]];
    [self replaceCurrentItemWithPlayerItem:item];
    [self play];

}

@end
